<?php


abstract class BaseDriver {
    
    /**
     * @var      array
     */
    protected $config;
    
    protected $prefix = null;
    
    /**
     * @param    array $config    
     */
    public function __construct($config) { }
    
    /**
     * @param    string $sql    
     * @return   PdoRecordSet
     */
    abstract public function query($sql);
    
    /**
     * @param    string $sql    
     * @return   int
     */
    abstract public function exec($sql);
    
    /**
     * @param    string $table    
     * @param    array $record    
     * @return   int
     */
    abstract public function update($table, $record, $condition);
    /**
     * @param    string $table
     * @param    array $record
     * @return   int
     */
    abstract public function getUpdateSql($table, $record, $condition);
    
    /**
     * @param    string $table    
     * @param    array $record    
     * @return   int
     */
    abstract public function insert($table, $record);

     /**
     * @param    string $table
     * @param    array $record
     * @return   int
     */
    abstract public function getInsertSql($table, $record);
    
    /**
     * @param    string $table    
     * @param    array $condition    
     * @return   PdoRecordSet
     */
    abstract public function select($table, $condition = array(), $fields = '*', $limit = null, $order = null);
    
    /**
     * @param    string $table    
     * @param    array $condition    
     * @return   int
     */
    abstract public function delete($table, $condition);
    /**
     * 取得数据库连接
     *
     * @return mixed
     */
    abstract public function getConnection();
}

?>